package com.jsb.service;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.jsb.mapper.SysMenuMapper;
import com.jsb.model.SysMenu;
import com.jsb.model.SysMenuExample;

@Service
public class SysMenuService{
	
	@Resource
	private SysMenuMapper sysMenuMapper;
	
	public void addSysMenu(SysMenu sysMenu) {
		sysMenuMapper.insertSelective(sysMenu);
	}
	
	public void delSysMenuById(String id) {
		sysMenuMapper.deleteByPrimaryKey(id);
	}
	
	public void updateSysMenu(SysMenu sysMenu) {
		sysMenuMapper.updateByPrimaryKeySelective(sysMenu);
	}
	
	public void updateSysMenuByExample(SysMenu sysMenu,SysMenuExample sysMenuExample){
	    sysMenuMapper.updateByExampleSelective(sysMenu,sysMenuExample);
	}
	
	public SysMenu getSysMenuById(String id) {
		return sysMenuMapper.selectByPrimaryKey(id);
	}
	
	public List<SysMenu> getPageSysMenu(SysMenuExample sysMenuExample) {
		return sysMenuMapper.selectPage(sysMenuExample);
	}
	
	public int countSysMenu(SysMenuExample sysMenuExample) {
		return sysMenuMapper.countByExample(sysMenuExample);
	}
	
	public List<SysMenu> selectByExample(SysMenuExample example){
	    return sysMenuMapper.selectByExample(example);
	}
}
